package com.superwein.dubbo.consumer.downgrade;

import com.superwein.dubbo.api.service.DemoService;

/**
 * 服务降级，比如某验权服务，当服务提供方全部挂掉后，客户端不抛出异常，而是通过 Mock 数据返回授权失败
 *
 * <dubbo:reference interface="com.foo.BarService" mock="com.foo.BarServiceMock" />
 * 或者
 * <dubbo:reference interface="com.foo.BarService" mock="return null" />
 */
public class DemoServiceMock implements DemoService {

    public String sayHello(String name) {
        return "触发服务降级";
    }
}
